作者 Cool
1 个管道 的构建 失败 耗费 4 秒

近期修复问题提交

@@ -27,6 +27,7 @@ class OrderController extends AdminBaseController @@ -27,6 +27,7 @@ class OrderController extends AdminBaseController
27 $this->order_model = new OrderModel(); 27 $this->order_model = new OrderModel();
28 $this->option_table = 'OrderOption'; 28 $this->option_table = 'OrderOption';
29 $this->order_sort_table = 'OrderSort'; 29 $this->order_sort_table = 'OrderSort';
  30 + parent::_initialize();
30 31
31 // 订单字段类型定义 32 // 订单字段类型定义
32 $this->sort_model[1] = '<div class="text_item form_options" data-validate="{validate}"> 33 $this->sort_model[1] = '<div class="text_item form_options" data-validate="{validate}">
@@ -106,11 +107,12 @@ class OrderController extends AdminBaseController @@ -106,11 +107,12 @@ class OrderController extends AdminBaseController
106 $where = [ 107 $where = [
107 'delete_time'=>0 108 'delete_time'=>0
108 ]; 109 ];
109 - if(isset($param['parent_name'])) {  
110 - $parent_name = '{"id":"46","type":"1","status":"0","checked":"1","values":"","user_choose":"'.$param['parent_name'].'"}';  
111 - $where['options'] = ['like','%'.$parent_name.'%']; 110 + if(!empty($param['parent_name'])) {
  111 +// $parent_name = unicode_encode($param['parent_name']);
  112 +// $parent_name = '"{"id":"46","type":"1","status":"0","checked":"1","values":"","user_choose":"'.$parent_name.'"}';
  113 + $where['parent_name'] = ['like','%'.$param['parent_name'].'%'];
112 } 114 }
113 - if(isset($param['mobile'])) { 115 + if(!empty($param['mobile'])) {
114 $mobile = '{"id":"49","type":"3","status":"0","checked":"1","values":"","user_choose":"'.$param['mobile'].'"}'; 116 $mobile = '{"id":"49","type":"3","status":"0","checked":"1","values":"","user_choose":"'.$param['mobile'].'"}';
115 $where['options'] = ['like','%'.$mobile.'%']; 117 $where['options'] = ['like','%'.$mobile.'%'];
116 } 118 }
@@ -167,6 +169,9 @@ class OrderController extends AdminBaseController @@ -167,6 +169,9 @@ class OrderController extends AdminBaseController
167 $orderList[$k]['mobile'] = $vo['user_choose']; 169 $orderList[$k]['mobile'] = $vo['user_choose'];
168 } 170 }
169 } 171 }
  172 + if(!empty($orderList[$k]['parent_name'])) {
  173 + Db::name('order')->update(['id'=>$v['id'],'parent_name'=>$orderList[$k]['parent_name']]);
  174 + }
170 } 175 }
171 $list->appends($param); 176 $list->appends($param);
172 $this->assign('list',$orderList); 177 $this->assign('list',$orderList);
@@ -218,12 +218,15 @@ class MemberSalesController extends HomeBaseController @@ -218,12 +218,15 @@ class MemberSalesController extends HomeBaseController
218 if(!$typeInfo) { 218 if(!$typeInfo) {
219 $this->error('电子订单类型错误'); 219 $this->error('电子订单类型错误');
220 } 220 }
221 - $mobile = ''; 221 + $mobile = $parent_name = '';
222 $typeInfo['options'] = json_decode($typeInfo['options'],true); 222 $typeInfo['options'] = json_decode($typeInfo['options'],true);
223 foreach ($typeInfo['options'] as $k=>$v) { 223 foreach ($typeInfo['options'] as $k=>$v) {
224 if($v['id'] == 49) { 224 if($v['id'] == 49) {
225 $mobile = $data[$k]; 225 $mobile = $data[$k];
226 } 226 }
  227 + if($v['id'] == 46) {
  228 + $parent_name = $data[$k];
  229 + }
227 $typeInfo['options'][$k]['user_choose'] = $data[$k]; 230 $typeInfo['options'][$k]['user_choose'] = $data[$k];
228 } 231 }
229 $order_insert = [ 232 $order_insert = [
@@ -232,7 +235,8 @@ class MemberSalesController extends HomeBaseController @@ -232,7 +235,8 @@ class MemberSalesController extends HomeBaseController
232 'options' => json_encode($typeInfo['options']), 235 'options' => json_encode($typeInfo['options']),
233 'order_sn' => cmf_get_order_sn().rand(0000,9999), 236 'order_sn' => cmf_get_order_sn().rand(0000,9999),
234 'number' => Session::get('user_sale.number'), 237 'number' => Session::get('user_sale.number'),
235 - 'over_time' => time() + 60*60*24*2 238 + 'over_time' => time() + 60*60*24*2,
  239 + 'parent_name' => $parent_name
236 ]; 240 ];
237 $validate = $this->validate($order_insert, 'admin/'.$this->order_table,'.add'); 241 $validate = $this->validate($order_insert, 'admin/'.$this->order_table,'.add');
238 if ($validate !== true) { 242 if ($validate !== true) {
@@ -146,6 +146,9 @@ @@ -146,6 +146,9 @@
146 <th>订单价格</th> 146 <th>订单价格</th>
147 <th>订单状态</th> 147 <th>订单状态</th>
148 <th>支付方式</th> 148 <th>支付方式</th>
  149 + <th>支付时间</th>
  150 + <th>家长姓名</th>
  151 + <th>移动电话</th>
149 <th>收集状态</th> 152 <th>收集状态</th>
150 <th>导出状态</th> 153 <th>导出状态</th>
151 <th width="130">发布时间</th> 154 <th width="130">发布时间</th>
@@ -1870,3 +1870,27 @@ function getAccessToken(){ @@ -1870,3 +1870,27 @@ function getAccessToken(){
1870 return $jssdk->getAccessToken(); 1870 return $jssdk->getAccessToken();
1871 } 1871 }
1872 1872
  1873 +//字符串转Unicode编码
  1874 +function unicode_encode($strLong) {
  1875 + $strArr = preg_split('/(?<!^)(?!$)/u', $strLong);//拆分字符串为数组(含中文字符)
  1876 + $resUnicode = '';
  1877 + foreach ($strArr as $str)
  1878 + {
  1879 + $bin_str = '';
  1880 + $arr = is_array($str) ? $str : str_split($str);//获取字符内部数组表示,此时$arr应类似array(228, 189, 160)
  1881 + foreach ($arr as $value)
  1882 + {
  1883 + $bin_str .= decbin(ord($value));//转成数字再转成二进制字符串,$bin_str应类似111001001011110110100000,如果是汉字"你"
  1884 + }
  1885 + $bin_str = preg_replace('/^.{4}(.{4}).{2}(.{6}).{2}(.{6})$/', '$1$2$3', $bin_str);//正则截取, $bin_str应类似0100111101100000,如果是汉字"你"
  1886 + $unicode = dechex(bindec($bin_str));//返回unicode十六进制
  1887 + $_sup = '';
  1888 + for ($i = 0; $i < 4 - strlen($unicode); $i++)
  1889 + {
  1890 + $_sup .= '0';//补位高字节 0
  1891 + }
  1892 + $str = '\\u' . $_sup . $unicode; //加上 \u 返回
  1893 + $resUnicode .= $str;
  1894 + }
  1895 + return $resUnicode;
  1896 +}