1提货卡号导入模板修改成xls文件,不再支持csv,
2兑换时,按电话号查询地址,如果订单表未查到,增加功能:从地址表查询地址和收件人姓名
2 files modified
24 ■■■■ changed files
forms/common/CommonUser.php 20 ●●●●● patch | view | raw | blame | history
plugins/exchange/views/library/edit.php 4 ●●●● patch | view | raw | blame | history
forms/common/CommonUser.php
@@ -14,6 +14,7 @@
use app\models\UserIdentity;
use app\models\UserInfo;
use app\models\Order;
use app\models\Address;
class CommonUser
{
@@ -228,6 +229,7 @@
    public static function getUserAndAddressByMobile($keyword)
    {
        $keyword = trim($keyword);
        $newList = [];
        $query = Order::find()->alias('o')->where([
            'AND',
@@ -236,8 +238,21 @@
        ]);
        $list = $query->orderBy(['created_at'=>SORT_DESC])->limit(1)->all();
        $newList = [];
        if(count($list) == 0){
            $query = Address::find()->alias('o')->where([
                'AND',
                ['o.mobile' => $keyword],
                ['o.is_delete' => '0'],
            ]);
            $list = $query->orderBy(['created_at'=>SORT_DESC])->limit(1)->all();
            /** @var User[] $list */
            foreach ($list as $k => $v) {
                $newList[] = [
                    'name' => $v->name,
                    'address' => $v->province.' '.$v->city.' '.$v->district.' '.$v->detail,
                ];
            }
        }else{
        /** @var User[] $list */
        foreach ($list as $k => $v) {
            $newList[] = [
@@ -245,6 +260,7 @@
                'address' => $v->address,
            ];
        }
        }
        return [
            'list' => $newList,
        ];
plugins/exchange/views/library/edit.php
@@ -776,7 +776,7 @@
        width="30%">
        <p flex="cross:center">
            <image src="statics/img/plugins/sigh.png" style="margin-right: 10px;width:30px;height: 30px;"></image>
            <span>请导入不大于1M的CSV文件</span>
            <span>请导入不大于1M的xls文件</span>
        </p>
        <span slot="footer" class="dialog-footer">
             <el-upload
@@ -784,7 +784,7 @@
                 action=""
                 :multiple="false"
                 :http-request="handleFile"
                 accept=".csv"
                 accept=".xls"
                 :on-change="excelChange"
                 :show-file-list="false">
                <el-button type="primary" >点击导入</el-button>