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

近期修复问题提交

... ... @@ -27,6 +27,7 @@ class OrderController extends AdminBaseController
$this->order_model = new OrderModel();
$this->option_table = 'OrderOption';
$this->order_sort_table = 'OrderSort';
parent::_initialize();
// 订单字段类型定义
$this->sort_model[1] = '<div class="text_item form_options" data-validate="{validate}">
... ... @@ -106,11 +107,12 @@ class OrderController extends AdminBaseController
$where = [
'delete_time'=>0
];
if(isset($param['parent_name'])) {
$parent_name = '{"id":"46","type":"1","status":"0","checked":"1","values":"","user_choose":"'.$param['parent_name'].'"}';
$where['options'] = ['like','%'.$parent_name.'%'];
if(!empty($param['parent_name'])) {
// $parent_name = unicode_encode($param['parent_name']);
// $parent_name = '"{"id":"46","type":"1","status":"0","checked":"1","values":"","user_choose":"'.$parent_name.'"}';
$where['parent_name'] = ['like','%'.$param['parent_name'].'%'];
}
if(isset($param['mobile'])) {
if(!empty($param['mobile'])) {
$mobile = '{"id":"49","type":"3","status":"0","checked":"1","values":"","user_choose":"'.$param['mobile'].'"}';
$where['options'] = ['like','%'.$mobile.'%'];
}
... ... @@ -167,6 +169,9 @@ class OrderController extends AdminBaseController
$orderList[$k]['mobile'] = $vo['user_choose'];
}
}
if(!empty($orderList[$k]['parent_name'])) {
Db::name('order')->update(['id'=>$v['id'],'parent_name'=>$orderList[$k]['parent_name']]);
}
}
$list->appends($param);
$this->assign('list',$orderList);
... ...
... ... @@ -218,12 +218,15 @@ class MemberSalesController extends HomeBaseController
if(!$typeInfo) {
$this->error('电子订单类型错误');
}
$mobile = '';
$mobile = $parent_name = '';
$typeInfo['options'] = json_decode($typeInfo['options'],true);
foreach ($typeInfo['options'] as $k=>$v) {
if($v['id'] == 49) {
$mobile = $data[$k];
}
if($v['id'] == 46) {
$parent_name = $data[$k];
}
$typeInfo['options'][$k]['user_choose'] = $data[$k];
}
$order_insert = [
... ... @@ -232,7 +235,8 @@ class MemberSalesController extends HomeBaseController
'options' => json_encode($typeInfo['options']),
'order_sn' => cmf_get_order_sn().rand(0000,9999),
'number' => Session::get('user_sale.number'),
'over_time' => time() + 60*60*24*2
'over_time' => time() + 60*60*24*2,
'parent_name' => $parent_name
];
$validate = $this->validate($order_insert, 'admin/'.$this->order_table,'.add');
if ($validate !== true) {
... ...
... ... @@ -146,6 +146,9 @@
<th>订单价格</th>
<th>订单状态</th>
<th>支付方式</th>
<th>支付时间</th>
<th>家长姓名</th>
<th>移动电话</th>
<th>收集状态</th>
<th>导出状态</th>
<th width="130">发布时间</th>
... ...
... ... @@ -1870,3 +1870,27 @@ function getAccessToken(){
return $jssdk->getAccessToken();
}
//字符串转Unicode编码
function unicode_encode($strLong) {
$strArr = preg_split('/(?<!^)(?!$)/u', $strLong);//拆分字符串为数组(含中文字符)
$resUnicode = '';
foreach ($strArr as $str)
{
$bin_str = '';
$arr = is_array($str) ? $str : str_split($str);//获取字符内部数组表示,此时$arr应类似array(228, 189, 160)
foreach ($arr as $value)
{
$bin_str .= decbin(ord($value));//转成数字再转成二进制字符串,$bin_str应类似111001001011110110100000,如果是汉字"你"
}
$bin_str = preg_replace('/^.{4}(.{4}).{2}(.{6}).{2}(.{6})$/', '$1$2$3', $bin_str);//正则截取, $bin_str应类似0100111101100000,如果是汉字"你"
$unicode = dechex(bindec($bin_str));//返回unicode十六进制
$_sup = '';
for ($i = 0; $i < 4 - strlen($unicode); $i++)
{
$_sup .= '0';//补位高字节 0
}
$str = '\\u' . $_sup . $unicode; //加上 \u 返回
$resUnicode .= $str;
}
return $resUnicode;
}
\ No newline at end of file
... ...