|
|
@@ -33,6 +33,44 @@ class OrderController extends BaseController
|
|
|
|
|
|
public $guestAccess = ['create-order', 'order-relate', 'fast-pay', 'info'];
|
|
|
|
|
|
+ public function actionAllFh()
|
|
|
+ {
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $ids = $post['ids'] ?? '';
|
|
|
+ if (empty($ids)) {
|
|
|
+ util::fail('请选择要合并发货的订单');
|
|
|
+ }
|
|
|
+ $arr = explode(',', $ids);
|
|
|
+ if (empty($arr)) {
|
|
|
+ util::fail('请选择要合并发货的订单哦');
|
|
|
+ }
|
|
|
+ $fhWl = $post['fhWl'] ?? '';
|
|
|
+ $fhWlNo = $post['fhWlNo'] ?? '';
|
|
|
+ $fhType = 0;
|
|
|
+ $params = [
|
|
|
+ 'fhType' => $fhType,
|
|
|
+ 'fhWl' => $fhWl,
|
|
|
+ 'fhWlNo' => $fhWlNo,
|
|
|
+ ];
|
|
|
+ $connection = Yii::$app->db;
|
|
|
+ $transaction = $connection->beginTransaction();
|
|
|
+ try {
|
|
|
+ $all = OrderClass::getAllByCondition(['id' => ['in', $ids]], null, '*', null, true);
|
|
|
+ foreach ($all as $order) {
|
|
|
+ if ($order->mainId != $this->mainId) {
|
|
|
+ util::fail('不是你的订单哦');
|
|
|
+ }
|
|
|
+ OrderClass::orderFh($order, $params, true);
|
|
|
+ }
|
|
|
+ $transaction->commit();
|
|
|
+ util::complete();
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ $transaction->rollBack();
|
|
|
+ Yii::error("操作失败原因:" . $e->getMessage());
|
|
|
+ util::fail('操作失败');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//合并打印 ssh 20230929
|
|
|
public function actionMergePrint()
|
|
|
{
|