You've already forked qlg.tsgz.moe
							
							TradeRule后台添加大体
This commit is contained in:
		
							
								
								
									
										46
									
								
								hyhproject/admin/model/TradeRule.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								hyhproject/admin/model/TradeRule.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,46 @@ | ||||
| <?php | ||||
|  | ||||
|  | ||||
| namespace wstmart\admin\model; | ||||
|  | ||||
|  | ||||
| use think\Db; | ||||
|  | ||||
| class TradeRule extends Base | ||||
| { | ||||
|     /** | ||||
|  | ||||
|      * 分页 | ||||
|  | ||||
|      */ | ||||
|  | ||||
|     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; | ||||
|  | ||||
|     } | ||||
|  | ||||
|  | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user