wugg hai 5 meses
pai
achega
2eeea1144f

+ 2 - 2
app/admin/common/YouZan.php

@@ -50,12 +50,12 @@ class YouZan
         return $this->Client->post($method,$this->apiVersion, $params);
     }
     private function GetToken(){
-        $token = Cache::get("YouZanToken");
+        $token = Cache::get("YouZanToken".$this->authorityId);
         if(isset($token['access_token'])&& $token['access_token']!=''){
             return  $token['access_token'];
         }
         $token =$this->Token->getSelfAppToken($this->authorityId,["refresh"=>true]);
-        Cache::set("YouZanToken",$token,3500);
+        Cache::set("YouZanToken".$this->authorityId,$token,3500*24*7);
         return $token['access_token'];
     }
 

+ 3 - 0
app/admin/controller/Consult.php

@@ -607,6 +607,9 @@ class Consult extends Base
                 $zxinfo["updatetime"] =date("Y-m-d H:i:s");
                 $bar=Db::name("consult_info")->save($zxinfo);
                 if($bar==false)throw  new \Exception("反馈商品更新失败");
+                 Db::name('consult_bids')
+                      ->where([['infoNo' ,'=', $zxinfo['infoNo']],['is_del','=',0],['status','<>',6]])
+                      ->update(['tax_status'=>3]);
                     //修改状态,添加待办
                     ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], [
                         "order_code" => $zxinfo['infoNo'],//咨询单详情编号

+ 3 - 0
app/admin/controller/Sale.php

@@ -1135,6 +1135,9 @@ class Sale extends Base
                     Db::rollback();
                     return error_show(1002, "咨询单修改失败");
                 } else {
+                      Db::name('consult_bids')
+                      ->where([["infoNo" ,"=", $zxinfo['infoNo']],["is_del","=",0],["status","<>",6]])
+                      ->update(["tax_status"=>3]);
                     //修改状态,添加待办
                     ActionLog::logAdd(['id'=>$this->uid,'nickname'=>$this->uname], [
                         "order_code" => $zx['infoNo'],//咨询单详情编号

+ 1 - 0
app/txx/controller/Act.php

@@ -62,6 +62,7 @@ class Act extends Base
       }
 
       $list=$this->model->where($condition)
+      ->order("id desc")
       ->paginate(["list_rows"=>$param['size'],"page"=>$param['page']])
       ->each(function(&$item){
         $item['act_status']=time()< strtotime($item['startTime'])?1:(time()> strtotime($item['endTime'])?3:2);

+ 10 - 9
app/txx/controller/Activity.php

@@ -161,7 +161,7 @@ class Activity extends Base{
     }
     public function info(){
         $param=$this->request->param(["id"=>""],"post","trim");
-        $info= $this->model->with(["act","platformYz"=>["platform","good"=>['unit','brand','category']],"promocode"])->findOrEmpty($param['id']);
+        $info= $this->model->with(["act","platformYz"=>["platform","good"=>['unit','brand','category']],"promocode"])->where(['is_del' => 0])->findOrEmpty($param['id']);
         if($info->isEmpty()){
             $this->error("信息有误");
         }
@@ -258,19 +258,20 @@ class Activity extends Base{
         if($info->isEmpty()){
             $this->error("信息有误");
         }
+        if($info->act_good_id!=0){
+            $act = $this->model->with(['act'])->where(['is_del' => 0, 'id' => $info->act_good_id])->findOrEmpty();
+            if (time()<=strtotime($act->endTime) && time()>=strtotime($act->startTime)) $this->error('活动正在进行中,不能删除');
+        }
         $info->is_del=1;
         try{
             $save= $info->save();
             if(!$save)throw new \Exception('删除失败');
-            if($info->act_good_id!==0){
-                $act= $this->model->with(["act"])->where(['is_del'=>0,'id'=>$info->act_good_id])->findOrEmpty();
-                if(!$act->isEmpty()){
+                if(isset($act) && !$act->isEmpty()){
                    if(time()<strtotime($act->startTime)){ //活动未开始
-                    $act->promocode_id=0;
-                    $act->status=1;
-                    $act->save();
-                    }
-                }
+                        $act->promocode_id=0;
+                        $act->status=1;
+                        $act->save();
+                   }
             }
         }catch (\Exception $e){
             $this->error($e->getMessage());