'ID', 'mall_id' => 'Mall ID', 'share_setting' => '分销设置情况', 'order_share_info' => '订单分销情况', 'created_at' => 'Created At', ]; } /** * @param $shareSetting array|string 分销设置情况 * @param $orderShareInfo array|string 订单分销情况 * @param $mallId integer 商城ID * @return bool * @throws Exception */ public static function create($shareSetting, $orderShareInfo, $mallId) { if (!$shareSetting) { throw new Exception('$shareSetting不能为空'); } if (!$orderShareInfo) { throw new Exception('$shareSetting不能为空'); } if (is_array($shareSetting)) { $shareSetting = Yii::$app->serializer->encode($shareSetting); } if (is_array($orderShareInfo)) { $orderShareInfo = Yii::$app->serializer->encode($orderShareInfo); } $model = new self(); $model->mall_id = $mallId; $model->share_setting = $shareSetting; $model->order_share_info = $orderShareInfo; $model->created_at = mysql_timestamp(); return $model->save(); } }