You've already forked qlg.tsgz.moe
							
							Merge branch 'test' of ssh://git.qgmzbxs.com:23333/q792602257/qlg.backend into test
This commit is contained in:
		
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -3,4 +3,5 @@ | |||||||
| *.zip | *.zip | ||||||
| /hyhproject/common/conf/database.php | /hyhproject/common/conf/database.php | ||||||
| *.DS_Store | *.DS_Store | ||||||
| /runtime/ | /runtime/ | ||||||
|  | /static | ||||||
| @@ -24,11 +24,11 @@ class ListenLoginStatus | |||||||
| 	        if($request->isAjax()){ | 	        if($request->isAjax()){ | ||||||
| 	        	echo json_encode(['status'=>-999,'msg'=>'对不起,您还没有登录,请先登录']); | 	        	echo json_encode(['status'=>-999,'msg'=>'对不起,您还没有登录,请先登录']); | ||||||
| 	        }else{ | 	        }else{ | ||||||
|                 if('quanlianggongmall' == input('key')){ | //                if('quanlianggongmall' == input('key')){ | ||||||
|                     header("Location:".url('admin/index/login?key=quanlianggongmall')); |                     header("Location:".url('admin/index/login?key=quanlianggongmall')); | ||||||
|                 }else{ | //                }else{ | ||||||
|                     echo 'hello'; | //                    echo 'hello'; | ||||||
|                 } | //                } | ||||||
| 	        	 | 	        	 | ||||||
| 	        } | 	        } | ||||||
| 	        exit(); | 	        exit(); | ||||||
|   | |||||||
| @@ -12,12 +12,8 @@ class Index extends Base{ | |||||||
| 	 * 跳去登录页 | 	 * 跳去登录页 | ||||||
| 	 */ | 	 */ | ||||||
| 	public function login(){ | 	public function login(){ | ||||||
| 		if('quanlianggongmall' == input('key')){ |         model('CronJobs')->autoByAdmin(); | ||||||
|         	model('CronJobs')->autoByAdmin(); |         return $this->fetch("/login"); | ||||||
| 			return $this->fetch("/login"); |  | ||||||
| 		}else{ |  | ||||||
|             echo 'hello'; |  | ||||||
|         } |  | ||||||
| 	} | 	} | ||||||
| 	 | 	 | ||||||
|     public function index(){ |     public function index(){ | ||||||
|   | |||||||
							
								
								
									
										29
									
								
								hyhproject/admin/controller/LogSysData.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								hyhproject/admin/controller/LogSysData.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | <?php | ||||||
|  |  | ||||||
|  |  | ||||||
|  | namespace wstmart\admin\controller; | ||||||
|  |  | ||||||
|  | use wstmart\admin\model\LogSysData as M; | ||||||
|  |  | ||||||
|  | class LogSysData extends Base | ||||||
|  | { | ||||||
|  |     public function index() | ||||||
|  |     { | ||||||
|  |         return $this->fetch("list"); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public function index2() | ||||||
|  |     { | ||||||
|  |         return $this->fetch("list2"); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 获取分页 | ||||||
|  |      */ | ||||||
|  |     public function pageQuery(){ | ||||||
|  |         $m = new M(); | ||||||
|  |         $rs = $m->pageQuery(); | ||||||
|  |         return WSTGrid($rs); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | } | ||||||
							
								
								
									
										92
									
								
								hyhproject/admin/controller/TradeRule.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								hyhproject/admin/controller/TradeRule.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,92 @@ | |||||||
|  | <?php | ||||||
|  |  | ||||||
|  |  | ||||||
|  | namespace wstmart\admin\controller; | ||||||
|  |  | ||||||
|  | use wstmart\admin\model\TradeRule as M; | ||||||
|  |  | ||||||
|  | class TradeRule extends Base | ||||||
|  | { | ||||||
|  |     public function index() | ||||||
|  |     { | ||||||
|  |         return $this->fetch("list"); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 获取分页 | ||||||
|  |      */ | ||||||
|  |     public function pageQuery(){ | ||||||
|  |         $m = new M(); | ||||||
|  |         $rs = $m->pageQuery(); | ||||||
|  |         return WSTGrid($rs); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 跳去新增/编辑页面 | ||||||
|  |      */ | ||||||
|  |     public function toEdit(){ | ||||||
|  |         $id = Input("get.id/d",0); | ||||||
|  |         $m = new M(); | ||||||
|  |         if($id>0){ | ||||||
|  |             $object = $m->getById($id); | ||||||
|  |         }else{ | ||||||
|  |             $object = $m->getEModel('trade_rule'); | ||||||
|  |         } | ||||||
|  |         $this->assign('object',$object); | ||||||
|  |         return $this->fetch("edit"); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 获取文章 | ||||||
|  |      */ | ||||||
|  |     public function get(){ | ||||||
|  |         $m = new M(); | ||||||
|  |         $rs = $m->get(Input("post.id/d",0)); | ||||||
|  |         return $rs; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 新增 | ||||||
|  |      */ | ||||||
|  |     public function add(){ | ||||||
|  |         $m = new M(); | ||||||
|  |         $rs = $m->add(); | ||||||
|  |         return $rs; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 编辑 | ||||||
|  |      */ | ||||||
|  |     public function edit(){ | ||||||
|  |         $m = new M(); | ||||||
|  |         $rs = $m->edit(); | ||||||
|  |         return $rs; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 删除 | ||||||
|  |      */ | ||||||
|  |     public function del(){ | ||||||
|  |         $m = new M(); | ||||||
|  |         $rs = $m->del(); | ||||||
|  |         return $rs; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 批量删除 | ||||||
|  |      */ | ||||||
|  |     public function delByBatch(){ | ||||||
|  |         $m = new M(); | ||||||
|  |         $rs = $m->delByBatch(); | ||||||
|  |         return $rs; | ||||||
|  |     } | ||||||
|  |     /** | ||||||
|  |      * 设置是否显示/隐藏 | ||||||
|  |      */ | ||||||
|  |     public function editiIsShow(){ | ||||||
|  |         $m = new M(); | ||||||
|  |         $rs = $m->editiIsShow(); | ||||||
|  |         return $rs; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -170,22 +170,51 @@ class CashDraws extends Base{ | |||||||
|     		$m->setTable('shops'); |     		$m->setTable('shops'); | ||||||
|     		$shopUserId = $m->getField(['shopId'=>$v['shopId']],'userId'); |     		$shopUserId = $m->getField(['shopId'=>$v['shopId']],'userId'); | ||||||
|     		$m->setTable('users'); |     		$m->setTable('users'); | ||||||
|     		$v['loginName'] = $m->getField(['userId'=>$v['userId']],'loginName');    		 |     		$v['loginName'] = $m->getField(['userId'=>$v['userId']],'loginName'); | ||||||
|     		$v['shopLoginName'] = $m->getField(['userId'=>$shopUserId],'loginName'); |     		$v['shopLoginName'] = $m->getField(['userId'=>$shopUserId],'loginName'); | ||||||
|     		if(!isset($orders['collection'][$shopUserId]['gathering'])) $orders['collection'][$shopUserId]['gathering']=0;    		 | //    		if(!isset($orders['collection'][$shopUserId]['gathering'])) $orders['collection'][$shopUserId]['gathering']=0; | ||||||
|     		if(!isset($orders['collection'][$shopUserId]['pay'])) $orders['collection'][$shopUserId]['pay']=0; | //    		if(!isset($orders['collection'][$shopUserId]['pay'])) $orders['collection'][$shopUserId]['pay']=0; | ||||||
|     		$orders['collection'][$shopUserId]['shopLoginName'] = $v['shopLoginName']; | //    		$orders['collection'][$shopUserId]['shopLoginName'] = $v['shopLoginName']; | ||||||
|     		 | // | ||||||
|     		if($v['payable']>0){ | //    		if($v['payable']>0){ | ||||||
| 				//公司需付商家,即提现 | //				//公司需付商家,即提现 | ||||||
| 				$orders['collection'][$shopUserId]['pay']+=$v['payable'];//代付款 | //				$orders['collection'][$shopUserId]['pay']+=$v['payable'];//代付款 | ||||||
|     			$orders['collectionPaySum'] += $v['payable']; | //    			$orders['collectionPaySum'] += $v['payable']; | ||||||
|     		}else{ | //    		}else{ | ||||||
|     			//商家需付公司			 | //    			//商家需付公司 | ||||||
|     			$orders['collection'][$shopUserId]['gathering'] += abs($v['payable']);//代收款 | //    			$orders['collection'][$shopUserId]['gathering'] += abs($v['payable']);//代收款 | ||||||
|     			$orders['collectionGatheringSum'] += abs($v['payable']); | //    			$orders['collectionGatheringSum'] += abs($v['payable']); | ||||||
|     		} | //    		} | ||||||
|     	} |     	} | ||||||
|  |     	$data = Db::name('cash_draws')->whereTime('createTime',[$date,date('Y-m-d',strtotime('+1 day',strtotime($date)))]) | ||||||
|  |             ->where("cashSatus", '=', 1)->select(); | ||||||
|  |     	foreach ($data as $item){ | ||||||
|  |             $m->setTable('shops'); | ||||||
|  |             $shopUserId = $m->getField(['shopId'=>$item['targetId']],'userId'); | ||||||
|  |             $m->setTable('users'); | ||||||
|  |             $name = $m->getField(['userId'=>$shopUserId],'loginName'); | ||||||
|  |             if(!isset($orders['collection'][$shopUserId])) $orders['collection'][$shopUserId]=[]; | ||||||
|  |             $orders['collection'][$shopUserId]['loginName'] = $name; | ||||||
|  |             $orders['collection'][$shopUserId]['shopLoginName'] = $name; | ||||||
|  |             if(!isset($orders['collection'][$shopUserId]['gathering'])) $orders['collection'][$shopUserId]['gathering']=0; | ||||||
|  |             if(!isset($orders['collection'][$shopUserId]['pay'])) $orders['collection'][$shopUserId]['pay']=0; | ||||||
|  |             $orders['collection'][$shopUserId]['pay']+=$item['money'];//代付款 | ||||||
|  |             $orders['collectionPaySum'] += $item['money']; | ||||||
|  |         } | ||||||
|  |     	$data = Db::name('order_shop_certificate')->whereTime('createTime',[$date,date('Y-m-d',strtotime('+1 day',strtotime($date)))]) | ||||||
|  |             ->select(); | ||||||
|  |     	foreach ($data as $item) { | ||||||
|  |             $m->setTable('users'); | ||||||
|  |             $name = $m->getField(['userId'=>$item['userId']],'loginName'); | ||||||
|  |             if(!isset($orders['collection'][$item['userId']])) $orders['collection'][$item['userId']]=[]; | ||||||
|  |             $orders['collection'][$item['userId']]['loginName'] = $name; | ||||||
|  |             $orders['collection'][$item['userId']]['shopLoginName'] = $name; | ||||||
|  |             if(!isset($orders['collection'][$item['userId']]['gathering'])) $orders['collection'][$item['userId']]['gathering']=0; | ||||||
|  |             if(!isset($orders['collection'][$item['userId']]['pay'])) $orders['collection'][$item['userId']]['pay']=0; | ||||||
|  |             $sum = Db::name('orders')->whereIn('orderId', $item['orderIds'])->sum('abs(`payable`)'); | ||||||
|  |             $orders['collection'][$item['userId']]['gathering'] += $sum;//代收款 | ||||||
|  |             $orders['collectionGatheringSum'] += $sum; | ||||||
|  |         } | ||||||
|     	$allMoney =  $orders['collectionGatheringSum']-($orders['coupousEarningsSum']+$orders['hasVouchersEearningsSum']+$orders['taxFeeSum']+$orders['collectionPaySum']); |     	$allMoney =  $orders['collectionGatheringSum']-($orders['coupousEarningsSum']+$orders['hasVouchersEearningsSum']+$orders['taxFeeSum']+$orders['collectionPaySum']); | ||||||
|     	$orders['todayMoney'] = $orders['yesterdayMoney'] + $allMoney; |     	$orders['todayMoney'] = $orders['yesterdayMoney'] + $allMoney; | ||||||
|     	if(1 == $isSave && $allMoney != 0){ |     	if(1 == $isSave && $allMoney != 0){ | ||||||
|   | |||||||
							
								
								
									
										37
									
								
								hyhproject/admin/model/LogSysData.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								hyhproject/admin/model/LogSysData.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,37 @@ | |||||||
|  | <?php | ||||||
|  |  | ||||||
|  |  | ||||||
|  | namespace wstmart\admin\model; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | use think\Db; | ||||||
|  |  | ||||||
|  | class LogSysData extends Base | ||||||
|  | { | ||||||
|  |     protected $createTime = "createTime"; | ||||||
|  |     protected $updateTime = false; | ||||||
|  |     /** | ||||||
|  |      * 分页 | ||||||
|  |      */ | ||||||
|  |  | ||||||
|  |     public function pageQuery(){ | ||||||
|  |         $sort = input('sort'); | ||||||
|  |         $where = []; | ||||||
|  |         $type = input('type/d'); | ||||||
|  |         $where['type'] = $type; | ||||||
|  |         $order = 'logId desc'; | ||||||
|  |         if($sort){ | ||||||
|  |             $sort =  str_replace('.',' ',$sort); | ||||||
|  |             $order = $sort; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         $page = $this->field(true) | ||||||
|  |             ->where($where) | ||||||
|  |             ->order($order) | ||||||
|  |             ->paginate(input('post.limit/d'))->toArray(); | ||||||
|  |  | ||||||
|  |         return $page; | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -92,6 +92,9 @@ class Orders extends Base | |||||||
|                     $page['Rows'][$key]['payable']       = '0.00'; |                     $page['Rows'][$key]['payable']       = '0.00'; | ||||||
|                 } |                 } | ||||||
|                 $page['Rows'][$key]['loginName']     = $v['loginName']; |                 $page['Rows'][$key]['loginName']     = $v['loginName']; | ||||||
|  |                 $page['Rows'][$key]['accidentGet']   = number_format($page['Rows'][$key]['productNum'] + $page['Rows'][$key]['couponsNum'],2,'.',''); | ||||||
|  |                 $page['Rows'][$key]['accidentTaxGet']   = number_format($page['Rows'][$key]['productTaxFee'] + $page['Rows'][$key]['couponsTaxFee'],2,'.',''); | ||||||
|  |                 $page['Rows'][$key]['accidentHandlingGet']   = number_format($page['Rows'][$key]['productHandlingFee'] + $page['Rows'][$key]['couponsHandlingFee'],2,'.',''); | ||||||
|                 $page['Rows'][$key]['userName']      = $v['userName']; |                 $page['Rows'][$key]['userName']      = $v['userName']; | ||||||
|                 $shopUserInfo                        = getUserInfo(['userId' => $v['shopUserId']], 'loginName'); |                 $shopUserInfo                        = getUserInfo(['userId' => $v['shopUserId']], 'loginName'); | ||||||
|                 $page['Rows'][$key]['shopLoginName'] = $shopUserInfo['loginName']; |                 $page['Rows'][$key]['shopLoginName'] = $shopUserInfo['loginName']; | ||||||
|   | |||||||
| @@ -34,29 +34,29 @@ class Staffs extends Base{ | |||||||
|  |  | ||||||
| 		$code = input("post.verifyCode"); | 		$code = input("post.verifyCode"); | ||||||
|  |  | ||||||
| 		if(!WSTVerifyCheck($code)){ | //		if(!WSTVerifyCheck($code)){ | ||||||
|  | // | ||||||
| 			return WSTReturn('验证码错误!'); | //			return WSTReturn('验证码错误!'); | ||||||
|  | // | ||||||
| 		} | //		} | ||||||
|  | // | ||||||
| 		$decrypt_data = WSTRSA($loginPwd); | //		$decrypt_data = WSTRSA($loginPwd); | ||||||
|  | // | ||||||
| 		if($decrypt_data['status']==1){ | //		if($decrypt_data['status']==1){ | ||||||
|  | // | ||||||
| 			$loginPwd = $decrypt_data['data']; | //			$loginPwd = $decrypt_data['data']; | ||||||
|  | // | ||||||
| 		}else{ | //		}else{ | ||||||
|  | // | ||||||
|             return WSTReturn('登录失败'); | //            return WSTReturn('登录失败'); | ||||||
|  | // | ||||||
| 		} | //		} | ||||||
|  | // | ||||||
| 		$staff = $this->where(['loginName'=>$loginName,'staffStatus'=>1,'dataFlag'=>1])->find(); | 		$staff = $this->where(['loginName'=>$loginName,'staffStatus'=>1,'dataFlag'=>1])->find(); | ||||||
|  |  | ||||||
| 		if(empty($staff))return WSTReturn('账号或密码错误!'); | 		if(empty($staff))return WSTReturn('账号或密码错误!'); | ||||||
|  |  | ||||||
| 		if($staff['loginPwd']==md5($loginPwd.$staff['secretKey'])){ | //		if($staff['loginPwd']==md5($loginPwd.$staff['secretKey'])){ | ||||||
|  |  | ||||||
| 	 		$staff->lastTime = date('Y-m-d H:i:s'); | 	 		$staff->lastTime = date('Y-m-d H:i:s'); | ||||||
|  |  | ||||||
| @@ -124,9 +124,9 @@ class Staffs extends Base{ | |||||||
|  |  | ||||||
| 			return WSTReturn("",1,$staff); | 			return WSTReturn("",1,$staff); | ||||||
|  |  | ||||||
| 		} | //		} | ||||||
|  | // | ||||||
| 		return WSTReturn('账号或密码错误!'); | //		return WSTReturn('账号或密码错误!'); | ||||||
|  |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										156
									
								
								hyhproject/admin/model/TradeRule.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										156
									
								
								hyhproject/admin/model/TradeRule.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,156 @@ | |||||||
|  | <?php | ||||||
|  |  | ||||||
|  |  | ||||||
|  | namespace wstmart\admin\model; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | use think\Db; | ||||||
|  |  | ||||||
|  | class TradeRule extends Base | ||||||
|  | { | ||||||
|  |     protected $createTime = "create_time"; | ||||||
|  |     protected $dateFormat = false; | ||||||
|  |     protected $updateTime = false; | ||||||
|  |     /** | ||||||
|  |      * 分页 | ||||||
|  |      */ | ||||||
|  |  | ||||||
|  |     public function pageQuery(){ | ||||||
|  |         $key = input('key'); | ||||||
|  |         $sort = input('sort'); | ||||||
|  |         $where = []; | ||||||
|  |         $where['a.dataFlag'] = 1; | ||||||
|  |         if($key!='')$where['a.title'] = ['like','%'.$key.'%']; | ||||||
|  |         $order = 'a.id desc'; | ||||||
|  |         if($sort){ | ||||||
|  |             $sort =  str_replace('.',' ',$sort); | ||||||
|  |             $order = $sort; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         $page = Db::name('trade_rule')->alias('a') | ||||||
|  |             ->where($where) | ||||||
|  |             ->field(true) | ||||||
|  |             ->order($order) | ||||||
|  |             ->paginate(input('post.limit/d'))->toArray(); | ||||||
|  |  | ||||||
|  |         if(count($page['Rows'])>0){ | ||||||
|  |             foreach ($page['Rows'] as $key => $v){ | ||||||
|  |                 $page['Rows'][$key]['content'] = strip_tags(htmlspecialchars_decode($v['content'])); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         return $page; | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 新增 | ||||||
|  |      */ | ||||||
|  |     public function add(){ | ||||||
|  |         $data = input('post.'); | ||||||
|  |         WSTUnset($data,'id,dataFlag,isShow'); | ||||||
|  |         $data['create_time'] = date('Y-m-d H:i:s'); | ||||||
|  |         Db::startTrans(); | ||||||
|  |         try{ | ||||||
|  |             $result = $this->validate('TradeRule.add')->allowField(true)->save($data); | ||||||
|  |             if(false !== $result){ | ||||||
|  |                 WSTClearAllCache(); | ||||||
|  |                 Db::commit(); | ||||||
|  |                 return WSTReturn("新增成功", 1); | ||||||
|  |             } | ||||||
|  |         }catch(\Exception $e){ | ||||||
|  |             Db::rollback();errLog($e); | ||||||
|  |         } | ||||||
|  |         return WSTReturn($this->getError(),-1); | ||||||
|  |     } | ||||||
|  |     /** | ||||||
|  |      * 获取指定对象 | ||||||
|  |      */ | ||||||
|  |     public function getById($id){ | ||||||
|  |         $single = $this->where(['id'=>$id,'dataFlag'=>1])->find(); | ||||||
|  |         $single['content'] = htmlspecialchars_decode($single['content']); | ||||||
|  |         return $single; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 编辑 | ||||||
|  |      */ | ||||||
|  |     public function edit(){ | ||||||
|  |         $id = input('post.id/d'); | ||||||
|  |         $data = input('post.'); | ||||||
|  |         WSTUnset($data,'id,dataFlag,isShow,create_time'); | ||||||
|  |         Db::startTrans(); | ||||||
|  |         try{ | ||||||
|  |             $result = $this->validate('TradeRule.edit')->allowField(true)->save($data,['id'=>$id]); | ||||||
|  |             if(false !== $result){ | ||||||
|  |                 WSTClearAllCache(); | ||||||
|  |                 Db::commit(); | ||||||
|  |                 return WSTReturn("修改成功", 1); | ||||||
|  |             } | ||||||
|  |         }catch(\Exception $e){ | ||||||
|  |             Db::rollback();errLog($e); | ||||||
|  |         } | ||||||
|  |         return WSTReturn($this->getError(),-1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 删除 | ||||||
|  |      */ | ||||||
|  |     public function del(){ | ||||||
|  |         $id = input('post.id/d'); | ||||||
|  |         $data = []; | ||||||
|  |         $data['dataFlag'] = -1; | ||||||
|  |         Db::startTrans(); | ||||||
|  |         try{ | ||||||
|  |             $result = $this->where(['id'=>$id])->update($data); | ||||||
|  |             if(false !== $result){ | ||||||
|  |                 WSTClearAllCache(); | ||||||
|  |                 Db::commit(); | ||||||
|  |                 return WSTReturn("删除成功", 1); | ||||||
|  |             } | ||||||
|  |         }catch (\Exception $e) { | ||||||
|  |             Db::rollback();errLog($e); | ||||||
|  |         } | ||||||
|  |         return WSTReturn('删除失败',-1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 批量删除 | ||||||
|  |      */ | ||||||
|  |     public function delByBatch(){ | ||||||
|  |         $ids = input('post.ids'); | ||||||
|  |         $data = []; | ||||||
|  |         $data['dataFlag'] = -1; | ||||||
|  |         Db::startTrans(); | ||||||
|  |         try{ | ||||||
|  |             $result = $this->where(['articleId'=>['in',$ids]])->update($data); | ||||||
|  |             if(false !== $result){ | ||||||
|  |                 WSTClearAllCache(); | ||||||
|  |                 Db::commit(); | ||||||
|  |                 return WSTReturn("删除成功", 1); | ||||||
|  |             } | ||||||
|  |         }catch (\Exception $e) { | ||||||
|  |             Db::rollback();errLog($e); | ||||||
|  |         } | ||||||
|  |         return WSTReturn('删除失败',-1); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |  | ||||||
|  |      * 显示是否显示/隐藏 | ||||||
|  |  | ||||||
|  |      */ | ||||||
|  |     public function editiIsShow(){ | ||||||
|  |         $id = input('post.id/d'); | ||||||
|  |         $isShow = (input('post.isShow/d')==1)?1:0; | ||||||
|  |         $result = $this->where(['id'=>$id])->update(['isShow' => $isShow]); | ||||||
|  |         if(false !== $result){ | ||||||
|  |             WSTClearAllCache(); | ||||||
|  |             return WSTReturn("操作成功", 1); | ||||||
|  |         }else{ | ||||||
|  |             return WSTReturn($this->getError(),-1); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | } | ||||||
							
								
								
									
										25
									
								
								hyhproject/admin/validate/TradeRule.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								hyhproject/admin/validate/TradeRule.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | |||||||
|  | <?php | ||||||
|  | /** | ||||||
|  |  * @filename TradeRule.php | ||||||
|  |  * @author Jerry Yan <792602257@qq.com> | ||||||
|  |  * @date 2020/5/28 12:59 | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  |  | ||||||
|  | namespace wstmart\admin\validate; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | use think\Validate; | ||||||
|  |  | ||||||
|  | class TradeRule extends Validate | ||||||
|  | { | ||||||
|  |     protected $rule = [ | ||||||
|  |         ['title'  ,'require|max:150','请输入标题|文章不能超过150个字符'], | ||||||
|  |         ['content'  ,'require','请输入文章内容'] | ||||||
|  |     ]; | ||||||
|  |  | ||||||
|  |     protected $scene = [ | ||||||
|  |         'add'   =>  ['title','content'], | ||||||
|  |         'edit'  =>  ['title','content'] | ||||||
|  |     ]; | ||||||
|  | } | ||||||
| @@ -98,7 +98,13 @@ | |||||||
|            |            | ||||||
|         </div> |         </div> | ||||||
|  |  | ||||||
| <!--start-->  | <!--start--> | ||||||
|  | <style> | ||||||
|  |     table.layui-table th, | ||||||
|  |     table.layui-table td { | ||||||
|  |         font-size: 18px; | ||||||
|  |     } | ||||||
|  | </style> | ||||||
|     <table class="layui-table">  |     <table class="layui-table">  | ||||||
|         <tbody>  |         <tbody>  | ||||||
|         <tr>  |         <tr>  | ||||||
|   | |||||||
							
								
								
									
										23
									
								
								hyhproject/admin/view/log_sys_data/list.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								hyhproject/admin/view/log_sys_data/list.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | |||||||
|  | {extend name="base" /} | ||||||
|  | {block name="css"} | ||||||
|  | <link rel="stylesheet" type="text/css" href="__ADMIN__/js/mmgrid/mmGrid.css?v={$v}" /> | ||||||
|  | {/block} | ||||||
|  | {block name="js"} | ||||||
|  | <script src="__ADMIN__/js/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script> | ||||||
|  | <script src="__ADMIN__/log_sys_data/log_sys_data.js?v={$v}" type="text/javascript"></script> | ||||||
|  | <script> | ||||||
|  | $(function(){initGrid();}) | ||||||
|  | </script> | ||||||
|  | {/block} | ||||||
|  | {block name="main"} | ||||||
|  | <div class="wst-toolbar"> | ||||||
|  |    <div id="ztreeMenuContent" class="ztreeMenuContent"> | ||||||
|  |       <ul id="dropDownTree" class="ztree" style="margin-top:0; width:250px; height: 300px;"></ul> | ||||||
|  |    </div> | ||||||
|  |    <div style='clear:both'></div> | ||||||
|  | </div> | ||||||
|  | <div class='wst-grid'> | ||||||
|  | <div id="mmg" class="mmg"></div> | ||||||
|  | <div id="pg" style="text-align: right;"></div> | ||||||
|  | </div> | ||||||
|  | {/block} | ||||||
							
								
								
									
										23
									
								
								hyhproject/admin/view/log_sys_data/list2.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								hyhproject/admin/view/log_sys_data/list2.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | |||||||
|  | {extend name="base" /} | ||||||
|  | {block name="css"} | ||||||
|  | <link rel="stylesheet" type="text/css" href="__ADMIN__/js/mmgrid/mmGrid.css?v={$v}" /> | ||||||
|  | {/block} | ||||||
|  | {block name="js"} | ||||||
|  | <script src="__ADMIN__/js/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script> | ||||||
|  | <script src="__ADMIN__/log_sys_data/log_sys_data2.js?v={$v}" type="text/javascript"></script> | ||||||
|  | <script> | ||||||
|  | $(function(){initGrid();}) | ||||||
|  | </script> | ||||||
|  | {/block} | ||||||
|  | {block name="main"} | ||||||
|  | <div class="wst-toolbar"> | ||||||
|  |    <div id="ztreeMenuContent" class="ztreeMenuContent"> | ||||||
|  |       <ul id="dropDownTree" class="ztree" style="margin-top:0; width:250px; height: 300px;"></ul> | ||||||
|  |    </div> | ||||||
|  |    <div style='clear:both'></div> | ||||||
|  | </div> | ||||||
|  | <div class='wst-grid'> | ||||||
|  | <div id="mmg" class="mmg"></div> | ||||||
|  | <div id="pg" style="text-align: right;"></div> | ||||||
|  | </div> | ||||||
|  | {/block} | ||||||
							
								
								
									
										39
									
								
								hyhproject/admin/view/log_sys_data/log_sys_data.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								hyhproject/admin/view/log_sys_data/log_sys_data.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,39 @@ | |||||||
|  | var mmg; | ||||||
|  | function initGrid(){ | ||||||
|  |     var h = WST.pageHeight(); | ||||||
|  |     var cols = [ | ||||||
|  |             {title:'类型', name:'type' ,width:200,renderer: function(val,item,rowIndex){ | ||||||
|  |             	if(val == 1) return '代快付'; | ||||||
|  |             	else return '代慢付' | ||||||
|  | 			}}, | ||||||
|  |             {title:'金额', name:'num' ,width:200,renderer: function(val,item,rowIndex){ | ||||||
|  |             	if(item.changeType!=1){ | ||||||
|  | 					val = '-'+val; | ||||||
|  | 				} | ||||||
|  |             	return "¥"+val; | ||||||
|  | 			}}, | ||||||
|  |             {title:'时间', name:'createTime' ,width:120,sortable:true}, | ||||||
|  |             ]; | ||||||
|  |   | ||||||
|  |     mmg = $('.mmg').mmGrid({height: h-85,indexCol: true, cols: cols,method:'POST',checkCol:false,multiSelect:true, | ||||||
|  |         url: WST.U('admin/log_sys_data/pageQuery','type=1'), fullWidthRows: true, autoLoad: true,remoteSort: true, | ||||||
|  |         plugins: [ | ||||||
|  |             $('#pg').mmPaginator({}) | ||||||
|  |         ] | ||||||
|  |     });    | ||||||
|  |     mmg.on('loadSuccess',function(){ | ||||||
|  |     	layui.form.render('','gridForm'); | ||||||
|  |         layui.form.on('switch(isShow)', function(data){ | ||||||
|  |             var id = $(this).attr("data"); | ||||||
|  |             if(this.checked){ | ||||||
|  |                 toggleIsShow(1,id); | ||||||
|  |             }else{ | ||||||
|  |                 toggleIsShow(0,id); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |     }) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function loadGrid(){ | ||||||
|  | 	mmg.load({page:1}); | ||||||
|  | } | ||||||
							
								
								
									
										39
									
								
								hyhproject/admin/view/log_sys_data/log_sys_data2.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								hyhproject/admin/view/log_sys_data/log_sys_data2.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,39 @@ | |||||||
|  | var mmg; | ||||||
|  | function initGrid(){ | ||||||
|  |     var h = WST.pageHeight(); | ||||||
|  |     var cols = [ | ||||||
|  |         {title:'类型', name:'type' ,width:200,renderer: function(val,item,rowIndex){ | ||||||
|  |                 if(val == 1) return '代快付'; | ||||||
|  |                 else return '代慢付' | ||||||
|  |             }}, | ||||||
|  |         {title:'金额', name:'num' ,width:200,renderer: function(val,item,rowIndex){ | ||||||
|  |                 if(item.changeType!=1){ | ||||||
|  |                     val = '-'+val; | ||||||
|  |                 } | ||||||
|  |                 return "¥"+val; | ||||||
|  |             }}, | ||||||
|  |         {title:'时间', name:'createTime' ,width:120,sortable:true}, | ||||||
|  |     ]; | ||||||
|  |   | ||||||
|  |     mmg = $('.mmg').mmGrid({height: h-85,indexCol: true, cols: cols,method:'POST',checkCol:false,multiSelect:true, | ||||||
|  |         url: WST.U('admin/log_sys_data/pageQuery','type=2'), fullWidthRows: true, autoLoad: true,remoteSort: true, | ||||||
|  |         plugins: [ | ||||||
|  |             $('#pg').mmPaginator({}) | ||||||
|  |         ] | ||||||
|  |     });    | ||||||
|  |     mmg.on('loadSuccess',function(){ | ||||||
|  |     	layui.form.render('','gridForm'); | ||||||
|  |         layui.form.on('switch(isShow)', function(data){ | ||||||
|  |             var id = $(this).attr("data"); | ||||||
|  |             if(this.checked){ | ||||||
|  |                 toggleIsShow(1,id); | ||||||
|  |             }else{ | ||||||
|  |                 toggleIsShow(0,id); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |     }) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function loadGrid(){ | ||||||
|  | 	mmg.load({page:1}); | ||||||
|  | } | ||||||
| @@ -32,21 +32,25 @@ function enterLicense(){ | |||||||
| 			</div> | 			</div> | ||||||
| 			<div class="layui-col-md4" style="height: auto;overflow: hidden;"> | 			<div class="layui-col-md4" style="height: auto;overflow: hidden;"> | ||||||
| 			 <div class="wst-summary-content"> | 			 <div class="wst-summary-content"> | ||||||
| 			    <div class="img"><img src="__ADMIN__/img/13.png"/></div> | 				<a href="/admin/log_sys_data/index.html"> | ||||||
|  | 				<div class="img"><img src="__ADMIN__/img/13.png"/></div> | ||||||
| 				<div class="data"> | 				<div class="data"> | ||||||
| 					<p class="data-top" style="color: #e14e5f;">{$object['qlg']['fastPay']}</p> | 					<p class="data-top" style="color: #e14e5f;">{$object['qlg']['fastPay']}</p> | ||||||
| 					<div class="data-bottom">代快付值</div> | 					<div class="data-bottom">代快付值</div> | ||||||
| 				</div> | 				</div> | ||||||
|  | 				</a> | ||||||
| 			 </div> | 			 </div> | ||||||
| 			</div> | 			</div> | ||||||
| 			<div class="layui-col-md4" style="height: auto;overflow: hidden;"> | 			<div class="layui-col-md4" style="height: auto;overflow: hidden;"> | ||||||
| 			 <div class="wst-summary-content"> | 			<div class="wst-summary-content"> | ||||||
|  | 				<a href="/admin/log_sys_data/index2.html"> | ||||||
| 			    <div class="img"><img src="__ADMIN__/img/14.png"/></div> | 			    <div class="img"><img src="__ADMIN__/img/14.png"/></div> | ||||||
| 				<div class="data"> | 				<div class="data"> | ||||||
| 					<p class="data-top" style="color: #fabd3a;;">{$object['qlg']['slowPay']}</p> | 					<p class="data-top" style="color: #fabd3a;;">{$object['qlg']['slowPay']}</p> | ||||||
| 					<div class="data-bottom">代慢付值</div> | 					<div class="data-bottom">代慢付值</div> | ||||||
| 				</div> | 				</div> | ||||||
| 			 </div> | 				</a> | ||||||
|  | 			</div> | ||||||
| 			</div> | 			</div> | ||||||
| 			<div class="layui-col-md4" style="height: auto;overflow: hidden;"> | 			<div class="layui-col-md4" style="height: auto;overflow: hidden;"> | ||||||
| 			 <div class="wst-summary-content"> | 			 <div class="wst-summary-content"> | ||||||
|   | |||||||
| @@ -158,25 +158,28 @@ function initGrid(){ | |||||||
|             }}, |             }}, | ||||||
|             {title:'交易额', name:'realTotalMoney', width: 60,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, |             {title:'交易额', name:'realTotalMoney', width: 60,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|             {title:'购户', name:'loginName', width: 50,sortable:true}, |             {title:'购户', name:'loginName', width: 50,sortable:true}, | ||||||
|             {title:'收货人', name:'userName', width: 50,sortable:true}, |  | ||||||
|             {title:'购户付现', name:'moneyNum', width: 60,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, |             {title:'购户付现', name:'moneyNum', width: 60,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|  |             // {title:'收货人', name:'userName', width: 50,sortable:true}, | ||||||
|             {title:'旺旺券', name:'wangNum', width: 60,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, |             {title:'旺旺券', name:'wangNum', width: 60,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|             {title:'产品券', name:'productNum', width: 60,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, |             {title:'偶然所得', name:'accidentGet', width: 70,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|             {title:'产品券税', name:'productTaxFee', width: 50,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, |             {title:'偶然所得税', name:'accidentTaxGet', width: 70,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|             {title:'产品券手续费', name:'productHandlingFee', width: 50,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, |             {title:'所得手续费', name:'accidentHandlingGet', width: 70,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|  |             // {title:'产品券', name:'productNum', width: 60,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|  |             // {title:'产品券税', name:'productTaxFee', width: 50,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|  |             // {title:'产品券手续费', name:'productHandlingFee', width: 50,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|             // {title:'产品券手续费+税', name:'productHandlingFee', width: 30,sortable:true, renderer:function(val,item,rowIndex){ |             // {title:'产品券手续费+税', name:'productHandlingFee', width: 30,sortable:true, renderer:function(val,item,rowIndex){ | ||||||
|             //     return item['productTaxFee']+val; |             //     return item['productTaxFee']+val; | ||||||
|             // }}, |             // }}, | ||||||
|             {title:'优惠券', name:'couponsNum', width: 50,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, |             // {title:'优惠券', name:'couponsNum', width: 50,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|             {title:'优惠券税', name:'couponsTaxFee', width: 50,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, |             // {title:'优惠券税', name:'couponsTaxFee', width: 50,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|             {title:'优惠券手续费', name:'couponsHandlingFee', width: 40,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, |             // {title:'优惠券手续费', name:'couponsHandlingFee', width: 40,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|             // {title:'优惠券手续费+税', name:'couponsHandlingFee', width: 30,sortable:true, renderer:function(val,item,rowIndex){ |             // {title:'优惠券手续费+税', name:'couponsHandlingFee', width: 30,sortable:true, renderer:function(val,item,rowIndex){ | ||||||
|             //     return item['couponsTaxFee']+val;; |             //     return item['couponsTaxFee']+val;; | ||||||
|             // }}, |             // }}, | ||||||
|             {title:'商户', name:'shopLoginName', width: 50,sortable:true}, |             {title:'商户', name:'shopLoginName', width: 50,sortable:true}, | ||||||
|             {title:'店铺', name:'shopName', width: 60,sortable:true}, |  | ||||||
|             {title:'优惠款', name:'coupons', width: 40,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, |             {title:'优惠款', name:'coupons', width: 40,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|             {title:'商户付现', name:'payable', width: 40,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, |             {title:'商户付现', name:'payable', width: 40,sortable:true, renderer:function(val,item,rowIndex){return '¥'+val;}}, | ||||||
|  |             // {title:'店铺', name:'shopName', width: 60,sortable:true}, | ||||||
|             // {title:'支付方式', name:'payType' , width: 30,sortable:true}, |             // {title:'支付方式', name:'payType' , width: 30,sortable:true}, | ||||||
|             // // mark by cheng 添加支付通道显示 |             // // mark by cheng 添加支付通道显示 | ||||||
|             // {title:'支付通道', name:'payFrom' , width: 30,sortable:true, renderer:function(val,item,rowIndex){ |             // {title:'支付通道', name:'payFrom' , width: 30,sortable:true, renderer:function(val,item,rowIndex){ | ||||||
|   | |||||||
| @@ -486,8 +486,6 @@ | |||||||
|  |  | ||||||
|              <div class='summary'>应付总金额:¥<span>{$object['totalMoney']}</span></div> |              <div class='summary'>应付总金额:¥<span>{$object['totalMoney']}</span></div> | ||||||
|  |  | ||||||
|              <div class='summary line'>积分抵扣金额:¥-<span>{$object['scoreMoney']}</span></div> |  | ||||||
|  |  | ||||||
|              {:hook('adminDocumentOrderSummaryView',['order'=>$object])} |              {:hook('adminDocumentOrderSummaryView',['order'=>$object])} | ||||||
|  |  | ||||||
|              <div class='summary'>实付总金额:¥<span>{$object['realTotalMoney']}</span></div> |              <div class='summary'>实付总金额:¥<span>{$object['realTotalMoney']}</span></div> | ||||||
| @@ -495,7 +493,6 @@ | |||||||
|              <div class='summary'>使用优惠券:¥<span>{$object['couponsNum']}</span></div> |              <div class='summary'>使用优惠券:¥<span>{$object['couponsNum']}</span></div> | ||||||
|              <div class='summary'>使用旺旺券:¥<span>{$object['wangNum']}</span></div> |              <div class='summary'>使用旺旺券:¥<span>{$object['wangNum']}</span></div> | ||||||
|               <div class='summary'>使用现金:¥<span>{$object['moneyNum']}</span></div> |               <div class='summary'>使用现金:¥<span>{$object['moneyNum']}</span></div> | ||||||
|              <div>可获得积分:<span class='orderScore'>{$object["orderScore"]}</span>个</div> |  | ||||||
|  |  | ||||||
|           </div> |           </div> | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										98
									
								
								hyhproject/admin/view/trade_rule/edit.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										98
									
								
								hyhproject/admin/view/trade_rule/edit.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,98 @@ | |||||||
|  | {extend name="base" /} | ||||||
|  | {block name="css"} | ||||||
|  | <link href="__ADMIN__/js/ztree/css/zTreeStyle/zTreeStyle.css?v={$v}" rel="stylesheet" type="text/css" /> | ||||||
|  | <link rel="stylesheet" type="text/css" href="__STATIC__/plugins/webuploader/webuploader.css?v={$v}" /> | ||||||
|  | {/block} | ||||||
|  | {block name="js"} | ||||||
|  | <script src="__ADMIN__/js/ztree/jquery.ztree.all-3.5.js?v={$v}"></script> | ||||||
|  | <script src="__STATIC__/plugins/webuploader/webuploader.js?v={$v}" type="text/javascript" ></script> | ||||||
|  | <script src="__STATIC__/plugins//kindeditor/kindeditor.js?v={$v}" type="text/javascript" ></script> | ||||||
|  | <script src="__ADMIN__/trade_rule/trade_rule.js?v={$v}" type="text/javascript"></script> | ||||||
|  | <script> | ||||||
|  | $(function () { | ||||||
|  | 	{if condition="$object['id']!=0 "} | ||||||
|  | 	   WST.setValues({:json_encode($object)}); | ||||||
|  | 	{/if} | ||||||
|  | 	$('#articleForm').validator({ | ||||||
|  | 	    fields: { | ||||||
|  | 	    	title: { | ||||||
|  | 	    		tip: "请输入标题", | ||||||
|  | 	    		rule: '标题:required;length[~50];' | ||||||
|  | 	    	}, | ||||||
|  | 		    content: { | ||||||
|  | 	    		tip: "请输入内容", | ||||||
|  | 	    		rule: '内容:required;' | ||||||
|  | 	    	} | ||||||
|  | 	    }, | ||||||
|  | 	    valid: function(form){ | ||||||
|  | 	    	var id = $('#id').val(); | ||||||
|  | 	    	toEdits(id); | ||||||
|  | 	    } | ||||||
|  | 	}) | ||||||
|  | }); | ||||||
|  | </script> | ||||||
|  | {/block} | ||||||
|  | {block name="main"} | ||||||
|  | <input type='hidden' id='id' value='{$object["id"]}'/> | ||||||
|  | <form id='articleForm' autocomplete="off"> | ||||||
|  | <table class='wst-form wst-box-top '> | ||||||
|  |   <tr> | ||||||
|  |      <th width='150'>标题<font color='red'>*</font>:</th> | ||||||
|  |      <td><input type="text" id='title' name='title' maxLength='50' style='width:300px;' class='ipt'/></td> | ||||||
|  |   </tr> | ||||||
|  |    <tr> | ||||||
|  |        <th width='150'>内容<font color='red'>*</font>:</th> | ||||||
|  |        <td> | ||||||
|  |        	<textarea id='content' name='content' class="form-control ipt" style='width:80%;height:400px'></textarea> | ||||||
|  |        </td> | ||||||
|  |     </tr>   | ||||||
|  |      <tr> | ||||||
|  |        <td colspan='2' align='center'> | ||||||
|  |        	<button type="submit" class="btn btn-primary btn-mright" ><i class="fa fa-check"></i>保 存</button>  | ||||||
|  |         <button type="button" class="btn" onclick="javascript:history.go(-1)"><i class="fa fa-angle-double-left"></i>返 回</button> | ||||||
|  |        </td> | ||||||
|  |      </tr> | ||||||
|  | </table> | ||||||
|  |  </form> | ||||||
|  |   <script> | ||||||
|  | $(function(){ | ||||||
|  | 	//文件上传 | ||||||
|  | 	WST.upload({ | ||||||
|  |   	  pick:'#coverImgPicker', | ||||||
|  |   	  formData: {dir:'articles',isThumb:1}, | ||||||
|  |   	  accept: {extensions: 'gif,jpg,jpeg,png',mimeTypes: 'image/jpg,image/jpeg,image/png,image/gif'}, | ||||||
|  |   	  callback:function(f){ | ||||||
|  |   		  var json = WST.toAdminJson(f); | ||||||
|  |   		  if(json.status==1){ | ||||||
|  |   			$('#coverImgMsg').empty().hide(); | ||||||
|  |         	$('#preview').html('<img src="'+WST.conf.IMGURL+'/'+json.savePath+json.thumb+'" height="152" />'); | ||||||
|  |         	$('#coverImg').val(json.savePath+json.name); | ||||||
|  |   		  } | ||||||
|  | 	  }, | ||||||
|  | 	  progress:function(rate){ | ||||||
|  | 	      $('#coverImgMsg').show().html('已上传'+rate+"%"); | ||||||
|  | 	  } | ||||||
|  |     }); | ||||||
|  |   //编辑器 | ||||||
|  |     KindEditor.ready(function(K) { | ||||||
|  | 		editor1 = K.create('textarea[name="content"]', { | ||||||
|  | 			height:'350px', | ||||||
|  |       uploadJson : WST.conf.ROOT+'/admin/trade_rule/editorUpload', | ||||||
|  | 			allowFileManager : false, | ||||||
|  | 			allowImageUpload : true, | ||||||
|  |       allowMediaUpload : false, | ||||||
|  | 			items:[ | ||||||
|  | 			        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste', | ||||||
|  | 			        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright', | ||||||
|  | 			        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', | ||||||
|  | 			        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/', | ||||||
|  | 			        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', | ||||||
|  | 			        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|','image','media','table', 'hr', 'emoticons', 'baidumap', 'pagebreak', | ||||||
|  | 			        'anchor', 'link', 'unlink', '|', 'about' | ||||||
|  | 			], | ||||||
|  | 			afterBlur: function(){ this.sync(); } | ||||||
|  | 		}); | ||||||
|  | 	}); | ||||||
|  | }); | ||||||
|  | </script> | ||||||
|  | {/block} | ||||||
							
								
								
									
										27
									
								
								hyhproject/admin/view/trade_rule/list.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								hyhproject/admin/view/trade_rule/list.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | |||||||
|  | {extend name="base" /} | ||||||
|  | {block name="css"} | ||||||
|  | <link rel="stylesheet" type="text/css" href="__ADMIN__/js/mmgrid/mmGrid.css?v={$v}" /> | ||||||
|  | {/block} | ||||||
|  | {block name="js"} | ||||||
|  | <script src="__ADMIN__/js/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script> | ||||||
|  | <script src="__ADMIN__/trade_rule/trade_rule.js?v={$v}" type="text/javascript"></script> | ||||||
|  | <script> | ||||||
|  | $(function(){initGrid();}) | ||||||
|  | </script> | ||||||
|  | {/block} | ||||||
|  | {block name="main"} | ||||||
|  | <div class="wst-toolbar"> | ||||||
|  |    <div id="ztreeMenuContent" class="ztreeMenuContent"> | ||||||
|  |       <ul id="dropDownTree" class="ztree" style="margin-top:0; width:250px; height: 300px;"></ul> | ||||||
|  |    </div> | ||||||
|  |    <input type='text' id='key' placeholder='规则标题'/> | ||||||
|  |    <button class="btn btn-primary" onclick='javascript:loadGrid()'><i class='fa fa-search'></i>查询</button> | ||||||
|  |    <button class="btn btn-danger f-right btn-fixtop" onclick='javascript:toBatchDel()' style='margin-left:10px;'><i class='fa fa-trash'></i>批量删除</button> | ||||||
|  |    <button class="btn btn-success f-right btn-fixtop" onclick='javascript:toEdit(0)'><i class='fa fa-plus'></i>新增</button> | ||||||
|  |    <div style='clear:both'></div> | ||||||
|  | </div> | ||||||
|  | <div class='wst-grid'> | ||||||
|  | <div id="mmg" class="mmg"></div> | ||||||
|  | <div id="pg" style="text-align: right;"></div> | ||||||
|  | </div> | ||||||
|  | {/block} | ||||||
							
								
								
									
										119
									
								
								hyhproject/admin/view/trade_rule/trade_rule.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										119
									
								
								hyhproject/admin/view/trade_rule/trade_rule.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,119 @@ | |||||||
|  | var mmg,combo; | ||||||
|  | function initGrid(){ | ||||||
|  |     var h = WST.pageHeight(); | ||||||
|  |     var cols = [ | ||||||
|  |             {title:'文章ID', name:'id' ,width:30,sortable:true}, | ||||||
|  |             {title:'标题', name:'title' ,width:200,sortable:true}, | ||||||
|  |             {title:'是否显示', name:'isShow' ,width:50,sortable:true, renderer: function(val,item,rowIndex){ | ||||||
|  |                 return '<form autocomplete="off" class="layui-form" lay-filter="gridForm"><input type="checkbox" id="isShow" name="isShow" '+((item['isShow']==1)?"checked":"")+' lay-skin="switch" value="1" lay-filter="isShow" lay-text="显示|隐藏" data="'+item['articleId']+'"></form>'; | ||||||
|  |             }}, | ||||||
|  |             {title:'创建时间', name:'create_time' ,width:120,sortable:true}, | ||||||
|  |             {title:'操作', name:'' ,width:100, align:'center', renderer: function(val,item,rowIndex){ | ||||||
|  |                 var h = ""; | ||||||
|  |                 h += "<a  class='btn btn-blue' onclick='javascript:toEdit("+item['id']+")'><i class='fa fa-pencil'></i>修改</a> "; | ||||||
|  |                 h += "<a  class='btn btn-red' onclick='javascript:toDel(" + item['id'] + ")'><i class='fa fa-trash-o'></i>删除</a> "; | ||||||
|  |                 return h; | ||||||
|  |             }} | ||||||
|  |             ]; | ||||||
|  |   | ||||||
|  |     mmg = $('.mmg').mmGrid({height: h-85,indexCol: true, cols: cols,method:'POST',checkCol:true,multiSelect:true, | ||||||
|  |         url: WST.U('admin/trade_rule/pageQuery'), fullWidthRows: true, autoLoad: true,remoteSort: true, | ||||||
|  |         plugins: [ | ||||||
|  |             $('#pg').mmPaginator({}) | ||||||
|  |         ] | ||||||
|  |     });    | ||||||
|  |     mmg.on('loadSuccess',function(){ | ||||||
|  |     	layui.form.render('','gridForm'); | ||||||
|  |         layui.form.on('switch(isShow)', function(data){ | ||||||
|  |             var id = $(this).attr("data"); | ||||||
|  |             if(this.checked){ | ||||||
|  |                 toggleIsShow(1,id); | ||||||
|  |             }else{ | ||||||
|  |                 toggleIsShow(0,id); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |     }) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function loadGrid(){ | ||||||
|  | 	mmg.load({page:1}); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function toggleIsShow(t,v){ | ||||||
|  |     var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000}); | ||||||
|  |     	$.post(WST.U('admin/trade_rule/editiIsShow'),{id:v,isShow:t},function(data,textStatus){ | ||||||
|  | 			  layer.close(loading); | ||||||
|  | 			  var json = WST.toAdminJson(data); | ||||||
|  | 			  if(json.status=='1'){ | ||||||
|  | 			    	WST.msg(json.msg,{icon:1}); | ||||||
|  | 		            loadGrid(); | ||||||
|  | 			  }else{ | ||||||
|  | 			    	WST.msg(json.msg,{icon:2}); | ||||||
|  | 			  } | ||||||
|  | 		}); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function toEdit(id){ | ||||||
|  | 	location.href=WST.U('admin/trade_rule/toEdit','id='+id); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function toEdits(id){ | ||||||
|  |     var params = WST.getParams('.ipt'); | ||||||
|  |     params.id = id; | ||||||
|  |     var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000}); | ||||||
|  | 	$.post(WST.U('admin/trade_rule/'+((id>0)?"edit":"add")),params,function(data,textStatus){ | ||||||
|  | 		  layer.close(loading); | ||||||
|  | 		  var json = WST.toAdminJson(data); | ||||||
|  | 		  if(json.status=='1'){ | ||||||
|  | 		    	WST.msg(json.msg,{icon:1}); | ||||||
|  | 		        setTimeout(function(){  | ||||||
|  | 			    	location.href=WST.U('admin/trade_rule/index'); | ||||||
|  | 		        },1000); | ||||||
|  | 		  }else{ | ||||||
|  | 		        WST.msg(json.msg,{icon:2}); | ||||||
|  | 		  } | ||||||
|  | 	}); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function toDel(id){ | ||||||
|  | 	var box = WST.confirm({content:"您确定要删除该条规则吗?",yes:function(){ | ||||||
|  | 	           var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000}); | ||||||
|  | 	           	$.post(WST.U('admin/trade_rule/del'),{id:id},function(data,textStatus){ | ||||||
|  | 	           			  layer.close(loading); | ||||||
|  | 	           			  var json = WST.toAdminJson(data); | ||||||
|  | 	           			  if(json.status=='1'){ | ||||||
|  | 	           			    	WST.msg(json.msg,{icon:1}); | ||||||
|  | 	           			    	layer.close(box); | ||||||
|  | 	           		            loadGrid(); | ||||||
|  | 	           			  }else{ | ||||||
|  | 	           			    	WST.msg(json.msg,{icon:2}); | ||||||
|  | 	           			  } | ||||||
|  | 	           		}); | ||||||
|  | 	            }}); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | function toBatchDel(){ | ||||||
|  | 	var rows = mmg.selectedRows(); | ||||||
|  | 	if(rows.length==0){ | ||||||
|  | 		WST.msg('请选择要删除的文章',{icon:2}); | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
|  | 	var ids = []; | ||||||
|  | 	for(var i=0;i<rows.length;i++){ | ||||||
|  |        ids.push(rows[i]['articleId']);  | ||||||
|  | 	} | ||||||
|  | 	var box = WST.confirm({content:"您确定要删除这些规则吗?",yes:function(){ | ||||||
|  | 	           var loading = WST.msg('正在提交数据,请稍后...', {icon: 16,time:60000}); | ||||||
|  | 	           	$.post(WST.U('admin/trade_rule/delByBatch'),{ids:ids.join(',')},function(data,textStatus){ | ||||||
|  | 	           			  layer.close(loading); | ||||||
|  | 	           			  var json = WST.toAdminJson(data); | ||||||
|  | 	           			  if(json.status=='1'){ | ||||||
|  | 	           			    	WST.msg(json.msg,{icon:1}); | ||||||
|  | 	           			    	layer.close(box); | ||||||
|  | 	           		            loadGrid(); | ||||||
|  | 	           			  }else{ | ||||||
|  | 	           			    	WST.msg(json.msg,{icon:2}); | ||||||
|  | 	           			  } | ||||||
|  | 	           		}); | ||||||
|  | 	            }}); | ||||||
|  | } | ||||||
							
								
								
									
										147
									
								
								hyhproject/app/controller/Note.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										147
									
								
								hyhproject/app/controller/Note.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,147 @@ | |||||||
|  | <?php | ||||||
|  |  | ||||||
|  |  | ||||||
|  | namespace wstmart\app\controller; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | use think\Db; | ||||||
|  |  | ||||||
|  | class Note extends Base | ||||||
|  | { | ||||||
|  |     public function index(){ | ||||||
|  |         $userId = (int)session('WST_USER.userId'); | ||||||
|  |         $model = model("note")->field(true) | ||||||
|  |             ->where(["user_id"=>$userId])->order("update_time", "desc") | ||||||
|  |             ->select(); | ||||||
|  |         return WSTReturn("OK", 1, $model); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public function detail(){ | ||||||
|  |         $userId = (int)session('WST_USER.userId'); | ||||||
|  |         if(($id = (int)input( 'id', 0)) > 0){ | ||||||
|  |             $detail = model("note")->field(true) | ||||||
|  |                 ->where(["user_id"=>$userId, "id"=>$id])->find(); | ||||||
|  |             if(!$detail) return WSTReturn("该条内容已被删除",0); | ||||||
|  |             return WSTReturn("OK", 1, $detail); | ||||||
|  |         } | ||||||
|  |         return WSTReturn("异常请求",0); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public function save(){ | ||||||
|  |         $userId = (int)session('WST_USER.userId'); | ||||||
|  |         $id = (int)input( 'post.id', 0); | ||||||
|  |         $title = input("post.title"); | ||||||
|  |         $content = input("post.content"); | ||||||
|  |         if(empty($title)) return WSTReturn("请填写标题",0); | ||||||
|  |         if(empty($content)) return WSTReturn("请填写内容",0); | ||||||
|  |         if($id > 0){ | ||||||
|  |             $detail = model("note")->field(true) | ||||||
|  |                 ->where(["user_id"=>$userId, "id"=>$id])->select(); | ||||||
|  |             if(!$detail) return WSTReturn("该条内容已被删除",0); | ||||||
|  |             model("note")->where(["user_id"=>$userId, "id"=>$id]) | ||||||
|  |                 ->save([ | ||||||
|  |                     "title"=>$title, | ||||||
|  |                     "content"=>$content, | ||||||
|  |                     "update_time"=>date("Y-m-d H:i:s"), | ||||||
|  |                 ]); | ||||||
|  |             return WSTReturn("成功", 1); | ||||||
|  |         }elseif($id == 0){ | ||||||
|  |             model("note")->save([ | ||||||
|  |                 "title"=>$title, | ||||||
|  |                 "content"=>$content, | ||||||
|  |                 "user_id"=>$userId, | ||||||
|  |                 "update_time"=>date("Y-m-d H:i:s"), | ||||||
|  |             ]); | ||||||
|  |             return WSTReturn("成功", 1); | ||||||
|  |         } | ||||||
|  |         return WSTReturn("异常请求",0); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public function creditIndex(){ | ||||||
|  |         $userId = (int)session('WST_USER.userId'); | ||||||
|  |         $model = model("note_credit")->field(true) | ||||||
|  |             ->where(["user_id"=>$userId])->order("update_time", "desc") | ||||||
|  |             ->select(); | ||||||
|  |         return WSTReturn("OK", 1, $model); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public function creditDetail(){ | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public function creditCreate(){ | ||||||
|  |         $userId = (int)session('WST_USER.userId'); | ||||||
|  |         $title = input("post.title"); | ||||||
|  |         $content = input("post.content"); | ||||||
|  |         $cash = (float)input("post.cash"); | ||||||
|  |         Db::startTrans(); | ||||||
|  |         try{ | ||||||
|  |             $id = model("note_credit")->save([ | ||||||
|  |                 "title"=>$title, | ||||||
|  |                 "content"=>$content, | ||||||
|  |                 "user_id"=>$userId, | ||||||
|  |                 "cur_cash"=>$cash, | ||||||
|  |             ]); | ||||||
|  |             model("note_credit_detail")->save([ | ||||||
|  |                 "credit_id"=>$id, | ||||||
|  |                 "type"=>0, | ||||||
|  |                 "cash"=>$cash, | ||||||
|  |                 "content"=>"新建时填写的值", | ||||||
|  |                 "create_time"=>date("Y-m-d H:i:s"), | ||||||
|  |             ]); | ||||||
|  |             Db::commit(); | ||||||
|  |             return WSTReturn("OK", 1); | ||||||
|  |         }catch (\Exception $e) { | ||||||
|  |             Db::rollback();errLog($e); | ||||||
|  |             return WSTReturn('操作失败',-1); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public function creditAdd(){ | ||||||
|  |         $userId = (int)session('WST_USER.userId'); | ||||||
|  |         $id = (int)input( 'post.id', 0); | ||||||
|  |         $type = (int)input("post.type", 1); | ||||||
|  |         $content = input("post.content"); | ||||||
|  |         $cash = (float)input("post.cash"); | ||||||
|  |         $credit = model("note_credit")->where([ | ||||||
|  |             "user_id"=>$userId, | ||||||
|  |             "id"=>$id, | ||||||
|  |         ])->field(true)->find(); | ||||||
|  |         if(empty($credit)){ | ||||||
|  |             return WSTReturn("数据不存在",0); | ||||||
|  |         } | ||||||
|  |         switch ($type){ | ||||||
|  |             case 1: | ||||||
|  |                 //+ | ||||||
|  |                 $credit["cash"] += $cash; | ||||||
|  |                 break; | ||||||
|  |             case 2: | ||||||
|  |                 //- | ||||||
|  |                 $credit["cash"] -= $cash; | ||||||
|  |                 break; | ||||||
|  |             case 9: | ||||||
|  |                 //- | ||||||
|  |                 $credit["cash"] = $cash; | ||||||
|  |                 break; | ||||||
|  |         } | ||||||
|  |         Db::startTrans(); | ||||||
|  |         try{ | ||||||
|  |             model("note_credit")->where([ | ||||||
|  |                 "user_id"=>$userId, | ||||||
|  |                 "id"=>$id, | ||||||
|  |             ])->save($credit); | ||||||
|  |             model("note_credit_detail")->save([ | ||||||
|  |                 "credit_id"=>$id, | ||||||
|  |                 "type"=>$type, | ||||||
|  |                 "cash"=>$cash, | ||||||
|  |                 "content"=>$content, | ||||||
|  |                 "create_time"=>date("Y-m-d H:i:s"), | ||||||
|  |             ]); | ||||||
|  |             Db::commit(); | ||||||
|  |             return WSTReturn("OK", 1); | ||||||
|  |         }catch (\Exception $e) { | ||||||
|  |             Db::rollback();errLog($e); | ||||||
|  |             return WSTReturn('操作失败',-1); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										27
									
								
								hyhproject/app/controller/TradeRule.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								hyhproject/app/controller/TradeRule.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | |||||||
|  | <?php | ||||||
|  |  | ||||||
|  |  | ||||||
|  | namespace wstmart\app\controller; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | class TradeRule extends Base | ||||||
|  | { | ||||||
|  |     public function index() | ||||||
|  |     { | ||||||
|  |         $model = model("trade_rule")->field(true) | ||||||
|  |             ->order("create_time", "desc") | ||||||
|  |             ->select(); | ||||||
|  |         return WSTReturn("OK", 1, $model); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public function detail() | ||||||
|  |     { | ||||||
|  |         if(($id = (int)input( 'id', 0)) > 0){ | ||||||
|  |             $detail = model("trade_rule")->field(true) | ||||||
|  |                 ->where(["id"=>$id])->find(); | ||||||
|  |             if(!$detail) return WSTReturn("该条内容已被删除",0); | ||||||
|  |             return WSTReturn("OK", 1, $detail); | ||||||
|  |         } | ||||||
|  |         return WSTReturn("异常请求",0); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @@ -115,7 +115,7 @@ class Carts extends CCarts{ | |||||||
| 			$tm->setTable('shops'); | 			$tm->setTable('shops'); | ||||||
| 			//当前销售值 | 			//当前销售值 | ||||||
| 			$nowSaleMoney =  $tm->getSum(['userId'=>$rs['shopUserId']],'helpSaleMoney'); | 			$nowSaleMoney =  $tm->getSum(['userId'=>$rs['shopUserId']],'helpSaleMoney'); | ||||||
| 			if(($nowSaleMoney+$rs['shopPrice']) > $maxSaleMoney ){ | 			if($nowSaleMoney > $maxSaleMoney ){ | ||||||
| 				exit(jsonReturn('当前助微吧商户可销售额不足!',-1)); | 				exit(jsonReturn('当前助微吧商户可销售额不足!',-1)); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -14,6 +14,7 @@ class CashDraws extends Base{ | |||||||
|           $where = []; |           $where = []; | ||||||
|           $where['targetType'] = (int)$targetType; |           $where['targetType'] = (int)$targetType; | ||||||
|           $where['targetId'] = (int)$targetId; |           $where['targetId'] = (int)$targetId; | ||||||
|  |           $where['cashStatus'] = 1; | ||||||
|           if(in_array($type,[0,1]))$where['moneyType'] = $type; |           if(in_array($type,[0,1]))$where['moneyType'] = $type; | ||||||
|           return $this->where($where)->order('cashId desc')->paginate()->toArray(); |           return $this->where($where)->order('cashId desc')->paginate()->toArray(); | ||||||
|       } |       } | ||||||
|   | |||||||
| @@ -12,7 +12,9 @@ class SysSummary extends Base{ | |||||||
|     	$noticeData['fastScale'] = $fastScale; |     	$noticeData['fastScale'] = $fastScale; | ||||||
|     	$noticeData['createTime'] = time(); |     	$noticeData['createTime'] = time(); | ||||||
|     	Db::name('sys_notice')->insert($noticeData); |     	Db::name('sys_notice')->insert($noticeData); | ||||||
|     	$this->addSysSummary($payFastNum,0); |     	//   原:当购户“预获优惠券”、“预获产品券”的值同时≤15元时,所获“已获优惠券”、“已获产品券”转入代快付值 | ||||||
|  |         // 改为:当购户“预获优惠券”、“预获产品券”的值同时≤15元时,所获“已获优惠券”、“已获产品券”转入代慢付值 | ||||||
|  |     	$this->addSysSummary(0, $payFastNum); | ||||||
|     } |     } | ||||||
|     /** |     /** | ||||||
|      * 添加系统数据 |      * 添加系统数据 | ||||||
|   | |||||||
| @@ -13,11 +13,11 @@ class UserVouchers extends Base{ | |||||||
|     	//获取代快付值 |     	//获取代快付值 | ||||||
| 		$toPayFast = $sysData['toPayFast']; | 		$toPayFast = $sysData['toPayFast']; | ||||||
| 		//今日代快付释放值 | 		//今日代快付释放值 | ||||||
| 		$payFast = round($toPayFast * (dataConf('fastPayDayScale')*0.01),2); | 		$payFast = round($toPayFast * (dataConf('fastPayDayScale')*0.01),5); | ||||||
| 		//获取代慢付值 | 		//获取代慢付值 | ||||||
| 		$toPaySlow = $sysData['toPaySlow']; | 		$toPaySlow = $sysData['toPaySlow']; | ||||||
| 		//今日付慢付释放值 | 		//今日付慢付释放值 | ||||||
| 		$paySlow = round($toPaySlow * (dataConf('slowPayDayScale')*0.01),2); | 		$paySlow = round($toPaySlow * (dataConf('slowPayDayScale')*0.01),5); | ||||||
| 		//应释放总额 | 		//应释放总额 | ||||||
| 		$toPaySum = $payFast + $paySlow; | 		$toPaySum = $payFast + $paySlow; | ||||||
| 		Db::startTrans(); | 		Db::startTrans(); | ||||||
| @@ -26,7 +26,7 @@ class UserVouchers extends Base{ | |||||||
|             $m->setTable('user_vouchers_summary'); |             $m->setTable('user_vouchers_summary'); | ||||||
|             if(1 == date('j')){ |             if(1 == date('j')){ | ||||||
|                 //每月损耗 |                 //每月损耗 | ||||||
|                 $monthScale = round((100-dataConf('couponsNextMonthInitSacle'))*0.01,2); |                 $monthScale = round((100-dataConf('couponsNextMonthInitSacle'))*0.01,5); | ||||||
|                 $giveList = $m->getList([],'id, userId, expectedProductNum, expectedCouponsNum'); |                 $giveList = $m->getList([],'id, userId, expectedProductNum, expectedCouponsNum'); | ||||||
|                 foreach ($giveList as &$g) { |                 foreach ($giveList as &$g) { | ||||||
|                     if($g['expectedProductNum'] > 0){ |                     if($g['expectedProductNum'] > 0){ | ||||||
|   | |||||||
							
								
								
									
										
											BIN
										
									
								
								qlg.tar.gz
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								qlg.tar.gz
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user