moonsflyer 7 månader sedan
förälder
incheckning
027bb0d1bb
2 ändrade filer med 9 tillägg och 5 borttagningar
  1. 6 4
      app/api/lists/supply_demand/SupplyDemandLists.php
  2. 3 1
      app/common.php

+ 6 - 4
app/api/lists/supply_demand/SupplyDemandLists.php

@@ -54,10 +54,10 @@ class SupplyDemandLists extends BaseApiDataLists implements ListsSearchInterface
     {
         $where[] = ['status', '=', 2];
 //        $where[] = ['expiration_time', '>=', time()];
-//        if (!empty($this->params['cate_id'])) {
-//
-//            $where[] = ['cate_id', 'like', '%' . ',' .$this->params['cate_id'].',' . '%'];
-//        }
+        if (!empty($this->params['flag'])) {
+            $where[] = ['user_id', '=', $this->userId];
+        }
+        outFileLog( $this->userId,'supplydemand','user_id');
 //
 //        if (!empty($this->params['area_id'])) {
 //
@@ -79,6 +79,8 @@ class SupplyDemandLists extends BaseApiDataLists implements ListsSearchInterface
      */
     public function lists(): array
     {
+
+
         $orderRaw = 'id desc';
 
         $field = 'id,user_id,title,type,cate_id,mobile,images,address,number,content,status,remark,create_time';

+ 3 - 1
app/common.php

@@ -15,7 +15,9 @@ function create_password(string $plaintext, string $salt) : string
 {
     return md5($salt . md5($plaintext . $salt));
 }
-
+function outFileLog($data,$filename='log',$title='data'){
+    file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/runtime/'.$filename.'.txt', PHP_EOL .date('Y-m-d h:i:s', time()).'~'.$title.':' . json_encode($data,JSON_UNESCAPED_UNICODE), FILE_APPEND);
+}
 
 /**
  * @notes 随机生成token值