You've already forked qlg.tsgz.moe
							
							TradeRule后台完成
This commit is contained in:
		| @@ -46,7 +46,7 @@ class TradeRule extends Base | ||||
|      */ | ||||
|     public function add(){ | ||||
|         $data = input('post.'); | ||||
|         WSTUnset($data,'id,dataFlag'); | ||||
|         WSTUnset($data,'id,dataFlag,isShow'); | ||||
|         $data['create_time'] = date('Y-m-d H:i:s'); | ||||
|         Db::startTrans(); | ||||
|         try{ | ||||
| @@ -68,7 +68,7 @@ class TradeRule extends Base | ||||
|     public function edit(){ | ||||
|         $id = input('post.id/d'); | ||||
|         $data = input('post.'); | ||||
|         WSTUnset($data,'id,dataFlag,create_time'); | ||||
|         WSTUnset($data,'id,dataFlag,isShow,create_time'); | ||||
|         Db::startTrans(); | ||||
|         try{ | ||||
|             $result = $this->validate('TradeRule.edit')->allowField(true)->save($data,['articleId'=>$articleId]); | ||||
| @@ -126,5 +126,22 @@ class TradeRule extends Base | ||||
|     } | ||||
|  | ||||
|  | ||||
|     /** | ||||
|  | ||||
|      * 显示是否显示/隐藏 | ||||
|  | ||||
|      */ | ||||
|     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); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user