diff --git a/app/api/lists/product/ProductLists.php b/app/api/lists/product/ProductLists.php index bc82f94b4..f757b8f00 100644 --- a/app/api/lists/product/ProductLists.php +++ b/app/api/lists/product/ProductLists.php @@ -30,11 +30,11 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface,Li */ public function setSearch(): array { - $name=$this->request->get('name',''); + $name=$this->request->get('store_name',''); // $where['%pipe_like%'] =['name'=>'store_name|bar_code']; if($name){ if(preg_match('/[\x{4e00}-\x{9fff}]+/u', $name)==1){ - $where['%like%']=['store_name']; + $where['%like%']=['store_name'=>'store_name']; }else{ $where['=']=['bar_code','cate_id']; } diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index f41874a8e..3e01812db 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -23,6 +23,8 @@ use app\common\model\system_store\SystemStoreStaff; use app\common\model\user\User; use app\common\model\user\UserAddress; use app\common\model\user\UserShip; +use Picqer\Barcode\BarcodeGeneratorJPG; +use Picqer\Barcode\BarcodeGeneratorPNG; use support\exception\BusinessException; use support\Log; use taoser\exception\ValidateException; @@ -227,7 +229,13 @@ class OrderLogic extends BaseLogic if ($params['shipping_type'] == 2) { $_order['status'] = 1; } - + //生成核销码 + $generator = new BarcodeGeneratorPNG(); + $barcode = $generator->getBarcode($verify_code, $generator::TYPE_CODE_128); + $findPath = '/image/barcode/'.time().'.png'; + $savePath = 'public'.$findPath; + file_put_contents($savePath, $barcode); + $_order['verify_img'] = $findPath; Db::startTrans(); try { $order = StoreOrder::create($_order);