浏览代码

Merge branch 'rquality' of 39.97.239.116:gyfl/xyzshop into rquality

stanley-king 4 年之前
父节点
当前提交
7b6f6089e6

+ 22 - 4
admin/control/merchant.php

@@ -1034,7 +1034,7 @@ class merchantControl extends SystemControl
 
 
         $match = function ($all,$cur)
         $match = function ($all,$cur)
         {
         {
-            $inserts = [];
+            $inserts = $updates = [];
             foreach ($all as $key => $value)
             foreach ($all as $key => $value)
             {
             {
 
 
@@ -1043,11 +1043,27 @@ class merchantControl extends SystemControl
                     $insert['store_id'] = $value['cfg']['store_id'];
                     $insert['store_id'] = $value['cfg']['store_id'];
                     $insert['qualitys'] = $value['cfg']['qualitys'];
                     $insert['qualitys'] = $value['cfg']['qualitys'];
                     $inserts[] = $insert;
                     $inserts[] = $insert;
+                }else{
+                    if($value['cfg']['qualitys'] != $cur[$key]['qualitys']){
+                        $update['provider_id'] = $cur[$key]['provider_id'];
+                        $update['qualitys'] = $value['cfg']['qualitys'];
+                        $updates[] = $update;
+                    }
                 }
                 }
             }
             }
-            return $inserts;
+            return [$inserts,$updates];
         };
         };
 
 
+        $updater = function ($mod,$updates)
+        {
+            if(empty($updates)) return;
+            foreach ($updates as $update) {
+                $provider_id = $update['provider_id'];
+
+                $data = ['qualitys' => $update['qualitys']];
+                $mod->editProvider($data, ['provider_id' => $provider_id]);
+            }
+        };
         $inserter = function ($mod,$type,$names)
         $inserter = function ($mod,$type,$names)
         {
         {
             foreach ($names as $name) {
             foreach ($names as $name) {
@@ -1065,13 +1081,15 @@ class merchantControl extends SystemControl
 
 
         $oil_items = $mod_prov->getProviderList(['type' => 1]);
         $oil_items = $mod_prov->getProviderList(['type' => 1]);
         $oil_items = $name_val($oil_items);
         $oil_items = $name_val($oil_items);
-        $oil_inserts = $match($oils,$oil_items);
+        [$oil_inserts,$oil_updates] = $match($oils,$oil_items);
 
 
         $phone_items = $mod_prov->getProviderList(['type' => 2]);
         $phone_items = $mod_prov->getProviderList(['type' => 2]);
         $phone_items = $name_val($phone_items);
         $phone_items = $name_val($phone_items);
-        $phone_inserts = $match($phones,$phone_items);
+        [$phone_inserts,$phone_updates] = $match($phones,$phone_items);
         $inserter($mod_prov,1,$oil_inserts);
         $inserter($mod_prov,1,$oil_inserts);
         $inserter($mod_prov,2,$phone_inserts);
         $inserter($mod_prov,2,$phone_inserts);
+        $updater($mod_prov,$oil_updates);
+        $updater($mod_prov,$phone_updates);
     }
     }
 
 
     public function changeProviderStateOp()
     public function changeProviderStateOp()

+ 1 - 1
admin/templates/default/merchant.edit.php

@@ -69,7 +69,7 @@
                     <input id="activity_state1" name="quality" <?php if($output['merchant']['quality'] == 3){ echo 'checked';}?> value="3" type="radio">卡密
                     <input id="activity_state1" name="quality" <?php if($output['merchant']['quality'] == 3){ echo 'checked';}?> value="3" type="radio">卡密
                     <input id="activity_state1" name="quality" <?php if($output['merchant']['quality'] == 4){ echo 'checked';}?> value="4" type="radio">三方
                     <input id="activity_state1" name="quality" <?php if($output['merchant']['quality'] == 4){ echo 'checked';}?> value="4" type="radio">三方
                     <input id="activity_state1" name="quality" <?php if($output['merchant']['quality'] == 5){ echo 'checked';}?> value="5" type="radio">慢充
                     <input id="activity_state1" name="quality" <?php if($output['merchant']['quality'] == 5){ echo 'checked';}?> value="5" type="radio">慢充
-                    <input id="activity_state1" name="quality" <?php if($output['merchant']['quality'] == 6){ echo 'checked';}?> value="6" type="radio">系统默认
+                    <input id="activity_state1" name="quality" <?php if($output['merchant']['quality'] == 11){ echo 'checked';}?> value="11" type="radio">系统默认
                 </td>
                 </td>
             </tr>
             </tr>
             </tbody>
             </tbody>

+ 4 - 4
admin/templates/default/refill.order.index.php

@@ -146,7 +146,7 @@
                 <td></td>
                 <td></td>
                 <td>
                 <td>
                     <a href="#" class="btns" onclick="hCopyChannel(event)">
                     <a href="#" class="btns" onclick="hCopyChannel(event)">
-                        <span><i class="icon-edit"></i>拷贝供方单号</span>
+                        <span><i class="icon-edit"></i>拷贝渠道单号</span>
                     </a>
                     </a>
                     <a href="#" class="btns" onclick="hCopyCardNo(event)">
                     <a href="#" class="btns" onclick="hCopyCardNo(event)">
                         <span><i class="icon-edit"></i>拷贝充值卡号</span>
                         <span><i class="icon-edit"></i>拷贝充值卡号</span>
@@ -279,13 +279,13 @@
             <?php } ?>
             <?php } ?>
         <?php } else { ?>
         <?php } else { ?>
             <tr class="no_data">
             <tr class="no_data">
-                <td colspan="17"><?php echo $lang['nc_no_record']; ?></td>
+                <td colspan="19"><?php echo $lang['nc_no_record']; ?></td>
             </tr>
             </tr>
         <?php } ?>
         <?php } ?>
         </tbody>
         </tbody>
         <tfoot>
         <tfoot>
         <tr class="tfoot">
         <tr class="tfoot">
-            <td colspan="15" id="dataFuncs">
+            <td colspan="19" id="dataFuncs">
                 <div class="pagination"> <?php echo $output['show_page']; ?> </div>
                 <div class="pagination"> <?php echo $output['show_page']; ?> </div>
             </td>
             </td>
         </tr>
         </tr>
@@ -319,7 +319,7 @@
     function hCopyChannel(e) {
     function hCopyChannel(e) {
         let str = ''
         let str = ''
         $('#tbody tr').each(function () {
         $('#tbody tr').each(function () {
-            let res = $(this).find('td').eq(14).text()
+            let res = $(this).find('td').eq(13).text()
             str += res + '\n'
             str += res + '\n'
         })
         })
         let oInput = document.createElement("textarea");
         let oInput = document.createElement("textarea");