1提货卡号导入模板修改成xls文件,不再支持csv,
2兑换时,按电话号查询地址,如果订单表未查到,增加功能:从地址表查询地址和收件人姓名
| | |
| | | use app\models\UserIdentity; |
| | | use app\models\UserInfo; |
| | | use app\models\Order; |
| | | use app\models\Address; |
| | | |
| | | class CommonUser |
| | | { |
| | |
| | | public static function getUserAndAddressByMobile($keyword) |
| | | { |
| | | $keyword = trim($keyword); |
| | | $newList = []; |
| | | |
| | | $query = Order::find()->alias('o')->where([ |
| | | 'AND', |
| | |
| | | ]); |
| | | |
| | | $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[] = [ |
| | |
| | | 'address' => $v->address, |
| | | ]; |
| | | } |
| | | } |
| | | return [ |
| | | 'list' => $newList, |
| | | ]; |
| | |
| | | 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 |
| | |
| | | action="" |
| | | :multiple="false" |
| | | :http-request="handleFile" |
| | | accept=".csv" |
| | | accept=".xls" |
| | | :on-change="excelChange" |
| | | :show-file-list="false"> |
| | | <el-button type="primary" >点击导入</el-button> |